using System;
using System.Collections;
using System.Collections.Specialized;
using System.Drawing;
using System.ComponentModel.Design;
using System.Windows.Forms;

namespace FormDesigner
{
	public class DictionaryService : IDictionaryService
	{
		Hashtable table = new Hashtable();
		
		public object GetKey(object val)
		{
			foreach (DictionaryEntry entry in table) 
			{
				if (entry.Value == val) 
				{
					return entry.Key;
				}
			}
			return null;
		}
		
		public object GetValue(object key)
		{
			return key == null ? null : table[key];
		}
		
		public void SetValue(object key, object val)
		{
			if (key != null) 
			{
				table[key] = val;
			}
		}
	}
}
